<template>
  <Dialog
    :title="dialogTitle"
    :model-value="dialogVisible"
    :width="'25%'"
    @close="
      () => {
        emit('close')
      }
    "
  >
    <div>
      <el-result :icon="iconType" :sub-title="subTitle" />
    </div>
    <template #footer>
      <el-button @click="submitForm" type="primary">确 定</el-button>
      <el-button @click="close">取 消</el-button>
    </template>
  </Dialog>
</template>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'

defineOptions({ name: 'NonPaymentTipDialog' })

defineProps({
  dialogVisible: propTypes.bool.def(false),
  iconType: propTypes.string.def('warning'),
  subTitle: propTypes.string.def('订单未支付完成,确认提交吗?')
})
const dialogTitle = ref('提示') // 弹窗的标题

const emit = defineEmits(['confirm', 'close'])

const submitForm = async () => {
  // 校验表单
  emit('confirm')
}
const close = async () => {
  // 校验表单
  emit('close')
}
</script>
